import { requestClient } from '#/api/request';

export interface tModelConfigEntity {
  id?: string;
  modelName?: string;
  modelKey?: string;
  modeStatus?: string;
}

export interface AccessMenuResult {
  success: boolean;
  code: number;
  message: string;
  data: {
    data: tModelConfigEntity[];
  };
}

/**
 * 分页object列表
 * @param params 查询参数
 */
export async function listApi(params: Record<string, any>) {
  const res = await requestClient.get<{ page: any }>(
    '/modelApi/TModelConfig/list',
    { params },
  );
  return res;
}
/**
 * 新增object
 */
export async function addApi(data: Partial<tModelConfigEntity>) {
  const res = await requestClient.post('/modelApi/TModelConfig/save', data);
  return res;
}

/**
 * 更新object
 */
export async function updateApi(data: Partial<tModelConfigEntity>) {
  const res = await requestClient.post('/modelApi/TModelConfig/update', data);
  return res;
}

/**
 * 批量更新object
 */
export async function updateBatchApi(dataList: tModelConfigEntity[]) {
  const res = await requestClient.post(
    '/modelApi/TModelConfig/updateBs',
    dataList,
  );
  return res;
}

/**
 * 删除object
 */
export async function deleteApi(ids: any) {
  const res = await requestClient.post('/modelApi/TModelConfig/delete', ids);
  return res;
}

export async function updateModeStatusApi(data: any) {
  const res = await requestClient.post(
    '/modelApi/TModelConfig/updateModeStatus',
    data,
  );
  return res;
}
